using DAL;
using Model;
using System.Data;

namespace BLL
{
    public class ClubUserBLL
    {
        private ClubUserDAL _clubUserDAL = new();

        //获取所有用户表
        public DataTable GetAllUsers()
        {
            return _clubUserDAL.GetAllUsers();
        }

        //获取所有用户实体集合
        public List<ClubUser> GetAllUserList()
        {
            return _clubUserDAL.GetAllUserList();
        }

        //根据Id获取某个用户
        public ClubUser? GetUserById(int id)
        {
            return _clubUserDAL.GetUserById(id);
        }

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="clubUser"></param>
        /// <returns></returns>
        public int UpdateClubUser(ClubUser clubUser)
        {
            return _clubUserDAL.UpdateClubUser(clubUser);
        }

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="clubUser"></param>
        /// <returns></returns>
        public int AddClubUser(ClubUser clubUser)
        {
            return _clubUserDAL.AddClubUser(clubUser);
        }

        public int DeleteClubUser(int id)
        {
            return _clubUserDAL.DeleteClubUser(id);
        }

    }
}
